/*
 * Copyright (c) 2010 Vadim Zhukov <persgray@gmail.com>
 *
 * Permission to use, copy, modify, and distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
 * copyright notice and this permission notice appear in all copies.
 *
 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 */

/* List of all sensor routines. To be included from sensor.c only. */

#ifdef HAS_BSD_SENSORS
int	sensor_bsd_init(struct wsensor *);
int	sensor_bsd_get(struct wsensor *, struct log_msg *);
#endif
int	sensor_loadavg_get(struct wsensor *, struct log_msg *);
int	sensor_syslog_bsd_init(struct wsensor *);
int	sensor_syslog_bsd_uninit(struct wsensor *);
int	sensor_syslog_bsd_get(struct wsensor *, struct log_msg *);
int	sensor_log_stream_init(struct wsensor *);
int	sensor_log_stream_uninit(struct wsensor *);
int	sensor_log_stream_get(struct wsensor *, struct log_msg *);

struct sensor_routine {
	const	char *name;
	int	(*init)(struct wsensor *);			/* optional */
	int	(*uninit)(struct wsensor *);			/* optional */
	int	(*get)(struct wsensor *, struct log_msg *);	/* required */
	int	flags;
} sensor_routines[] = {
#ifdef HAS_BSD_SENSORS
{ "bsd",	&sensor_bsd_init,	NULL,	&sensor_bsd_get,	SENSOR_F_GAUGE },
#endif
{ "loadavg",	NULL,	NULL,	&sensor_loadavg_get,	SENSOR_F_GAUGE },
{ "syslog",	&sensor_syslog_bsd_init,	&sensor_syslog_bsd_uninit,	&sensor_syslog_bsd_get,	SENSOR_F_POLLABLE },
{ "log_stream",	&sensor_log_stream_init,	&sensor_log_stream_uninit,	&sensor_log_stream_get,	SENSOR_F_POLLABLE },
};
